<script language="javascript">
var dialogWidth=$(window).width()*0.2;
var dialogHeight=$(window).height()*0.06*2;
$(function(){
	$("#searchBtn").click(function(){
		artDialog(
		        {	
			        'title':'按条件查询',
			        width:dialogWidth,
			        height:  dialogHeight ,
			        okVal:"查询",
			        cancelVal:'关闭',
		            content:"<form id='searchForm' method='get' action='/cny/withdraw'>"+$('#searchdiv').html()+"</form>",
		            lock:true,
		        },
		        function(){
		                $('#searchForm').submit();
		        },
		        function(){
		            return true;
		        }
		);
		});
});
</script>
<!--  搜索表单  -->
<div  id="searchdiv" style="display:none;">
<input  type='hidden'  name='sid' value='<?php echo $sid?>'/>
 <table style="width:100%;height:100%" border=0>
	<tr>
	  <td valign='middle' align="right"  style="padding:1  1 1 1;width:20%"   >用户UID</td><td  valign='middle' align="left"  >
		<input type='text' name="uid" style="padding:1  1 1 1;width:80%"  value='<?php echo isset($get['uid'])?$get['uid']:''?>' />
	  </td>
	</tr>
	<tr>
	  <td valign='middle' align="right"  style="padding:1  1 1 1;width:20%"   >订单号</td><td  valign='middle' align="left"  >
		<input type='text' name="orderno" style="padding:1  1 1 1;width:80%"  value='<?php echo isset($get['orderno'])?$get['orderno']:''?>' />
	  </td>
	</tr>
 </table>
  <input  type="submit" value="提交"   style="display:none" />
</div>

<div class="container-fluid">
    <div class="widget-box">
		<div class="widget-title">
			<span class="icon">
				<i class="icon-th"></i>
			</span>
			<h5>CNY提现</h5>
			<span style="height:38px;line-height:38px;">
				<input class="btn btn-success btn-mini" type="button" style="cursor:pointer" id='searchBtn'  value="搜索条件">
				<a  href="/cny/withdraw?sid=<?php echo $sid;?>" class="btn btn-info btn-mini">清空查询</a>
			</span>
		</div>
		<div class="widget-content nopadding">
			<table   style="width:100%" class='table table-bordered table-striped'>
				<thead>
				<tr class="strong">
					<th>UID</th>
					<th>orderno</th>
					<th>openid</th>
					<th>提现银行</th>
					<th>提现地区</th>
					<th>银行地址</th>
					<th>卡号</th>
					<th>姓名</th>
					<th>提现金额</th>
					<th>手续费</th>
					<th>实到金额</th>
					<th>状态</th>
					<th>发送/取消时间<br>创建时间</th>
					<th >操作</th>
				</tr>
				</thead>
				<tbody>
				<?php if(!empty($page_data)) foreach($page_data as $items){?>
				<tr>
					<td><?php echo $items['uid'];?></td>
					<td><?php echo $items['orderno'];?></td>
					<td><?php echo $items['openid'];?></td>
					<td><?php echo $items['bank']['bank'];?></td>
					<td><?php echo $items['bank']['prov'],'-',$items['bank']['city'];?></td>
					<td><?php echo $items['bank']['bank_name'];?></td>
					<td><?php echo $items['bank']['card_no'];?></td>
					<td><?php echo $items['bank']['card_name'];?></td>
					<td>￥<?php echo $items['amount'];?></td>
					<td>￥<?php echo $items['fee'];?></td>
					<td>￥<?php echo $items['send_amount'];?></td>
					<td>
					<?php 
						if($items['send_status']==1){
							echo "发送成功";
						}elseif($items['send_status']==-1){
							echo "取消提现";
						}else{
							echo "处理中";
					}?>
					</td>
					<td><?php echo $items['create_time'];?><br><?php echo $items['send_time'];?></td>
					<td style="padding: 3px">
					<?php if($items['send_status']==0){?>
						<a  href="/cny/doWithdraw?orderno=<?php echo $items['orderno']?>&sid=<?php echo $sid?>&status=1">改为已发送</a> | 
						<a  href="/cny/doWithdraw?orderno=<?php echo $items['orderno']?>&sid=<?php echo $sid?>&status=-1">取消订单</a>
					<?php }?>
					</td>
				</tr>            		
				<?php }?>
				</tbody>
			</table>
		</div>
		<div id="page" style="width:50%" class="dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_full_numbers">
		   <?php echo $page_html;?>
		</div>
  </div>
  </div>